#!/usr/bin/env python

import gtk
from signals import decryptDialogSignals
import gettext
gettext.install('blendIT','locale');

class decryptDialog(gtk.Dialog):

   def __init__(self,blend,conv,eMID):
      gtk.Dialog.__init__(self,_("Decrypt Message"),
                          blend.gui.chatWindow,
                          gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT,
                          (gtk.STOCK_CANCEL, gtk.RESPONSE_REJECT,
                           gtk.STOCK_OK, gtk.RESPONSE_ACCEPT));

      vbox = gtk.VBox();
      text = gtk.Label(_("To decrypt the message, please enter the password below"));
      text.show();
      entry = gtk.Entry();
      entry.set_visibility(False);
      entry.show();
      check = gtk.CheckButton(_("Remember password for future messages from this buddy"));
      check.show();
      vbox.pack_start(text,True,True);
      vbox.pack_start(entry);
      vbox.pack_start(check,False,False);
      vbox.set_spacing(8);
      vbox.show();

      self.vbox.pack_start(vbox,True,True,0);

      sigs = decryptDialogSignals.signals(blend);
      self.connect('response',sigs.on_response,entry,check,conv,eMID);
      def sig(widget): widget.destroy();
      self.connect('close',sig);
      self.set_border_width(4);
